const regs = {
    email: /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
    nickName: /^[\u4e00-\u9fa5a-zA-Z0-9_-]{6,12}$/,
    number: /^(\+|-)?[0-9]+$/,
    password: /^(?![a-zA-Z]+$)(?!\d+$)(?![^\da-zA-Z\s]+$).{8,}$/,
    version: /^([1-9]\d|[1-9])(.([1-9]\d|\d)){2}$/
}

const checkEmail = (value) => {
    return regs.email.test(value);
}

const checkPassword = (value) => {
    return regs.password.test(value);
}

const checkCheckCode = (value) => {
    return regs.number.test(value);
}

const checkNickName = (value) => {
    return regs.nickName.test(value);
}

const checkNumber = (value) => {
    return regs.number.test(value);
}

const checkVersion = (value) => {
    return regs.version.test(value);
}

export default {
    checkEmail,
    checkPassword,
    checkCheckCode,
    checkNickName,
    checkNumber,
    checkVersion
}